<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:s="http://jboss.org/seam/faces"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:mumu="http://java.sun.com/jsf/composite/mumu">
    <h:form id="UserFormEntity" prependId="false" style="width: 700px;">
        <rich:messages globalOnly="true"/>
        <a4j:outputPanel id="editUserEntity" ajaxRendered="true" layout="block">
            <h:panelGrid columns="3" id="userRequiceInput" style="padding: 10px;">
                <mumu:inputLabel inputId="userName" label="#{msg['user.table.userName']}" requice="true"/>
                <h:inputText id="userName" value="#{userBean.entity.userName}"/>
                <rich:message id="userNameMessage" for="userName"/>

                <mumu:inputLabel inputId="password" label="#{msg['login.Password']}" requice="true" rendered="#{userBean.entity.id eq 0}"/>
                <h:inputSecret id="password" value="#{userBean.entity.plaintextPassword}" rendered="#{userBean.entity.id eq 0}"/>
                <rich:message id="passwordMessage" for="password" rendered="#{userBean.entity.id eq 0}"/>

                <mumu:inputLabel inputId="confirmPassword" label="#{msg['user.form.confirm.password']}" requice="true" rendered="#{userBean.entity.id eq 0}"/>
                <h:inputSecret id="confirmPassword" value="#{userBean.entity.password}" rendered="#{userBean.entity.id eq 0}"/>
                <rich:message id="password2Message" for="confirmPassword" rendered="#{userBean.entity.id eq 0}"/>
            </h:panelGrid>
            <h:panelGrid columns="6" id="otherUserName" style="padding-left: 10px;">
                <mumu:inputLabel inputId="nickName" label="#{msg['user.table.realName']}"/>
                <h:inputText id="nickName" value="#{userBean.entity.nickName}"/>
                <rich:message id="nickNameMessage" for="nickName"/>

                <mumu:inputLabel inputId="address" label="#{msg['user.form.home_adress']}"/>
                <h:inputText id="address" value="#{userBean.entity.homeAddress}"/>
                <rich:message id="addressMessage" for="address"/>

                <mumu:inputLabel inputId="homephone" label="#{msg['user.form.home_phone']}"/>
                <h:inputText id="homephone" value="#{userBean.entity.homePhone}"/>
                <rich:message id="homePhoneMessage" for="homephone"/>

                <mumu:inputLabel inputId="email" label="#{msg['user.form.email']}"/>
                <h:inputText id="email" value="#{userBean.entity.email}"/>
                <rich:message id="emailMessage" for="email"/>

                <mumu:inputLabel inputId="mobile" label="#{msg['user.form.mobile']}"/>
                <h:inputText id="mobile" value="#{userBean.entity.mobile}"/>
                <rich:message id="mobileMessage" for="email"/>

                <mumu:inputLabel inputId="qq" label="#{msg['user.form.qq']}"/>
                <h:inputText id="qq" value="#{userBean.entity.qq}"/>
                <rich:message id="qqMessage" for="qq"/>

                <mumu:inputLabel inputId="birthday" label="#{msg['user.table.birthday']}"/>
                <rich:calendar id="birthday" datePattern="yyyy-MM-dd" value="#{userBean.entity.birthday}"
                               locale="zh_CN" converter="longDateConverter"/>
                <rich:message id="birthdayMessage" for="birthday"/>
            </h:panelGrid>
            <rich:tabPanel id="UserInfoTab">
                <rich:tab header="部门信息">

                </rich:tab>
                <rich:tab header="角色信息">

                </rich:tab>
            </rich:tabPanel>
            <mumu:validateInfo/>
        </a4j:outputPanel>
        <h:panelGroup layout="block" style="text-align: center;" id="ActionForm">
            <a4j:commandButton value="#{msg['action.save']}" action="#{userBean.save}"
                               render="userlist@body userScroller" execute="userEntity"
                               oncomplete="PawnPopup.hide('userEntity',true)"/>

            <a4j:commandButton value="#{msg['action.cancel']}" immediate="true" render="@none" execute="@none"
                               onclick="PawnPopup.hide('userEntity');"/>

        </h:panelGroup>
        <s:validateForm validatorId="confirmPwdValidator"/>
    </h:form>
</ui:composition>